inheritance and Shareable-Edit???

Hello,

Currently during different phases of a Modules life cycle I have a script that changes the permission from Engineering to V&V. My question is, when a Module had shareable edit turned on the permissions sometime are not inherited when running the script. I have created the following code to turn inhertance back on. I am doing something wrong when running the intinial script or is this a know defect with shareable-edit? Does anyone notice a defect with my code below?

Thank you
Jim
 

Module m = current
m = edit(fullName m, true,true,true)
if (null m){ack "{null} Parameter for current module!";halt;}
 
if (null current Module) {ack "Please run this program from a module";halt;} 
else if (!isEdit current) {ack "current module must be editable to set permissions";halt;}
 
void inhertTable(Object o)
{
    if (table o) 
        { 
                Object tbl= getTable (o) 
                inherited tbl 
                Object rowHead 
                
                for rowHead in table tbl do {inherited rowHead}
        }
}
 
void main(Module m)
{
        Object o
        for o in entire m do {
                string err
                err = set(o,read|write|change,null) // null means alter the
                inherited o
                inhertTable(o)
                                                                                        // default ACL record
                if (!null err) {
                        ack "problem setting default ACL: " err
                        halt
                }
        }
}
 
/*************************************************      
                                        MAIN
*************************************************/
 
main(m)
save(m) // Saving...
close(m) // Closing...

SystemAdmin - Fri Jan 27 10:07:26 EST 2012

Re: inheritance and Shareable-Edit???
llandale - Fri Jan 27 11:21:59 EST 2012

Its not a "defect" its an "unfortunate design feature" that shareable edit sections are those objects that have "specific" access. So if you have a shareable module and modify the module accesses, its "unfortunate" that the sections don't "inherit" the new accesses.

If you have assigned certain sections to certain groups, perhaps the "requirements group" may edit section "3.2" and the "test group" can edit section "4" then you have a nightmare problem managing access.

If not, and you want all the shared sections to "inherit" the new module accesses but remain "specific" sections, then you need to "refresh" them all; but this must be done top down making sure you reset a parent before reseting a child. I've got a recursive algorithm:

void Reset(Object obj)
{  bool IsInherited = false
   isAccessInherited(obj, IsInherited)
   if (!IsInherited and !isDeleted(obj) and canModify(obj))
   {  inherited(obj)
      specific(obj)
   }
   Object oChild
   for oChild in obj do
   {  Reset(oChild)  // ** RECURSION **
   }
}  // end Reset(Obj)
void Reset(Module mod)
{  Object oTop
   for oTop in top(mod) do
   {  Reset(oTop)
   }
}  // end Reset(Mod)
Reset(current Module)


As for your code:

 

  • You don't need "inheritTable"; the "for o in entire" loop will find all the objects.
  • You are setting all objects Inherited, losing your shared sections.
  • I suppose your "set" command will fail for objects that are current Inherited. I don't think you need this in any case; just manually set that access for "Everybody else" in the module access tab.


-Louie